package com.resume.controller;

import com.resume.service.XueLiService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;

/**
 * @Author: 梁云亮
 * @Date: 2021/7/13 17:25
 * @Describe:
 */
@Api(value = "学历控制器：XueLiController", tags = "XueLiController：学历控制器")
@Slf4j
@Controller
@RequestMapping("/xueLi")
public class XueLiController {
    @Resource
    private XueLiService xueLiService;

    @ApiOperation(value = "打开简历列表页面", notes = "打开简历列表页面")
    @GetMapping("/openXueLi")
    public String openXueLi() {
        return "base/xueLi";
    }

    @GetMapping("/xueLi/xueLiAdd")
    public String xueLiAdd() {
        return "base/xueLi_add";
    }

//    @ApiOperation(value = "显示简历列表", notes = "显示简历列表")
//    @ResponseBody
//    @GetMapping("/v1/list")
//    public Result<DataTableResponse<XueLi>> list() {
//        List<XueLi> xueLiList = xueLiService.list();
//
//        DataTableResponse<XueLi> dataTableResponse = new DataTableResponse<>();
//        dataTableResponse.setSEcho(3);
//        dataTableResponse.setITotalRecords(80L);
//        dataTableResponse.setITotalDisplayRecords(70L);
//        dataTableResponse.setAaData(xueLiList);
//        return ResultUtil.success(200, "数据查询成功", dataTableResponse);
//    }

//    @ApiOperation(value = "修改简历的状态", notes = "修改简历的状态")
//    @ResponseBody
//    @GetMapping("/v1/modifyXueLiStatus")
//    public Result modifyXueLiStatus(Integer id, Integer status) {
//        try {
//            xueLiService.modifyXueLiStatus(id, status);
//            return ResultUtil.success(ResultEnum.SUCCESS);
//        } catch (Exception e) {
//            throw new ResumeException(ResultEnum.SQL_ERROR);
//        }
//    }

//    @ApiOperation(value = "修改简历", notes = "根据编号修改简历")
//    @ResponseBody
//    @GetMapping("/v1/modify")
//    public Result modify(XueLi xueLi) {
//        try {
//            xueLiService.modify(xueLi);
//            return ResultUtil.success(ResultEnum.SUCCESS);
//        } catch (Exception e) {
//            throw new ResumeException(ResultEnum.SQL_ERROR);
//        }
//    }

//    @ApiOperation(value = "增加简历", notes = "增加简历")
//    @ResponseBody
//    @GetMapping("/v1/create")
//    public Result create(XueLi xueLi) {
//        xueLi.setStatus(GlobalConst.Common.STATUS_ENABLE);
//        try {
//            xueLiService.save(xueLi);
//            return ResultUtil.success(ResultEnum.SUCCESS);
//        } catch (Exception e) {
//            throw new ResumeException(ResultEnum.SQL_ERROR);
//        }
//    }

}
